/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
// src/logical/commodity/commodity.service.js
import { Injectable } from '@nestjs/common'

@Injectable()
export class CommodityService {
    /**
     * 查询商品列表
     * @param {*} body
     * @param {string} username
     * @returns {Promise<any>}
     * @memberof CommodityService
     */
    async queryCommodityList(body: any): Promise<any> {
        const { pageIndex = 1, pageSize = 10, keywords = '' } = body
        // 分页查询条件
    }

    /**
     * 创建商品
     *
     * @param {*} body
     * @param {string} username
     * @returns {Promise<any>}
     * @memberof CommodityService
     */
    async createCommodity(body: any, username: string): Promise<any> {}

    /**
     * 修改商品
     *
     * @param {*} body
     * @param {string} username
     * @returns
     * @memberof CommodityService
     */
    async updateCommodity(body: any, username: string) {
        const { id, columnId, name, description, saleMoney, marketPrice } = body

        return {
            code: 200,
            msg: 'Success'
        }
    }

    /**
     * 删除商品
     *
     * @param {*} body
     * @returns
     * @memberof CommodityService
     */
    async deleteCommodity(body: any) {
        const { id } = body
        return {
            code: 200,
            msg: 'Success'
        }
    }
}
